<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        console.dir(Object);
        let obj1 = {
            name: '于明杨'
        }
        let obj2 = {
            color: '喜欢睡觉'
        }
        let obj3 = {
            sex: '女'
        }

        // 把obj2，obj3……，对象上的属性都添加到obj1当中
        Object.assign(obj1, obj2, obj3);
        console.log(obj1);


        let obj4 = Object.create(obj1);
        obj4.name = '唱，跳 rup';
        console.log(obj4);

        // object.entries 将现有的对象上的属性名和属性值 健值对 变为数组
        console.log(Object.entries(obj1));

        // object.freeze() 可以冻结一个对象，冻结该对象后，不能对该对象进行增删改查
        let obj_freeze = Object.freeze(obj1);
        console.log(obj_freeze);
        obj_freeze.sex = 'girl';
        console.log(obj_freeze);
        console.log('===============');

        // object.isFrozen 查看这个对象是否冻结，冻结true,不懂姐false
        console.log(Object.isFrozen(obj_freeze));
        console.log(Object.isFrozen(obj2));

    </script>
</body>

</html>